package scaladuct

import javax.validation.{ValidationException, ConstraintViolation, Validation, ValidatorFactory}

/**
 * <p>
 * Created by IntelliJ IDEA.
 * User: zslajchrt
 * Date: Jun 28, 2010
 * Time: 8:33:27 PM
 */
abstract class Particle(var name: String) {
  def this() = this (null)
  //  require(name ne null, "Particle name cannot be null")
  //  require(name != "", "Particle name cannot be empty string")
  override def toString = name;
  override def hashCode = name.hashCode;
  def canEqual(other: Any) = other.isInstanceOf[Particle]

  override def equals(other: Any) = other match {
    case that: Particle =>
      (that canEqual this) &&
              (that.name == this.name)
    case _ => false
  }

  def newConfig[X](classifier: Class[X]): ConfigPage[X]
}